package rov.ui.view;


import rov.ui.WindowManager;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;


public class TasksView implements IView
{
    private static final String TITLE = "Tasks";

    private Container mWindow;
    private JPanel mRoot;


    public String getTitle()
    {
        return TITLE;
    }

    public void create()
    {
     	mWindow = WindowManager.getInstance().createWindow(TITLE, true, true, true, true, 250, 435);
        mRoot = new JPanel();
        mWindow.add(mRoot);

        JPanel exeOrder = new JPanel(new GridLayout(16, 1));
        exeOrder.setBorder(BorderFactory.createTitledBorder("Task Execution Order"));

        exeOrder.add(new JCheckBox("Mapping                         0:15"));
        exeOrder.add(new JCheckBox("Ship Orientation           1:00"));
        exeOrder.add(new JCheckBox("Mast Attach                  2:00"));
        exeOrder.add(new JCheckBox("Mast Detach + Lift       2:15"));
        exeOrder.add(new JCheckBox("Sensor (Black Panel)   2:45"));
        exeOrder.add(new JCheckBox("Sonar (Side 1)               3:30"));
        exeOrder.add(new JCheckBox("Metal Detection           6:30"));
        exeOrder.add(new JCheckBox("Sensor (Crate)              7:00"));
        exeOrder.add(new JCheckBox("Sonar (Rear)                7:45"));
        exeOrder.add(new JCheckBox("Sonar (Side 2)              8:30"));
        exeOrder.add(new JCheckBox("Sensor (Black Panel)  9:00"));
        exeOrder.add(new JCheckBox("Land on Fuel Tank      10:00"));
        exeOrder.add(new JCheckBox("Pump Fuel                     12:00"));
        exeOrder.add(new JCheckBox("Place Fuel Caps            13:00"));
        exeOrder.add(new JCheckBox("Measure Ship Length  14:00"));
        exeOrder.add(new JCheckBox("Dock                               15:00"));

        JPanel ordered = new JPanel(new GridLayout(5, 1));
        ordered.setBorder(BorderFactory.createTitledBorder("Ordered Tasks"));

        ordered.add(new JCheckBox("Mast"));
        ordered.add(new JCheckBox("Coral"));
        ordered.add(new JCheckBox("Sensor Calibration"));
        ordered.add(new JCheckBox("Fuel Extration"));
        ordered.add(new JCheckBox("Fuel Caps"));

        JPanel unordered = new JPanel(new GridLayout(5, 1));
        unordered.setBorder(BorderFactory.createTitledBorder("Unordered Tasks"));

        unordered.add(new JCheckBox("Ship Orientation"));
        unordered.add(new JCheckBox("Map Shipwreck"));
        unordered.add(new JCheckBox("Metal Detection"));
        unordered.add(new JCheckBox("Sonar"));
        unordered.add(new JCheckBox("Ship Length"));

        mRoot.add(exeOrder);
        mRoot.add(unordered);
        mRoot.add(ordered);
    }

    public void destroy()
    {
    }

    public void pause()
    {
    }

    public void resume()
    {
    }
}
